﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MailMarketing.Models.Entity;

namespace MailMarketing.Models.Repositorio
{
    public abstract class Repositorio
    {
        protected MailMarketingEntities objEntities;

        public Repositorio()
        {
            this.objEntities = new MailMarketingEntities();
        }

        /// <summary>
        /// Salvar na base de dados
        /// </summary>
        /// <returns></returns>
        public bool salvar()
        {
            bool salvo = false;
            try
            {
                this.objEntities.SaveChanges();
                salvo = true;
            }
            catch (Exception)
            {
                salvo = false;
            }
            return salvo;
        }
    }
}